package com.kgc.novel.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@TableName("book_content")
@Api(tags = "书本内容管理类")
public class BookContent implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 章节
     */
    @ApiParam("章节")
    @TableField("chapter")
    private String chapter;
    /**
     * 书本编号
     */
    @ApiParam("书本编号")
    @TableField("book_id")
    private String bookId;
    /**
     * 书本内容
     */
    @ApiParam("书本内容")
    @TableField("content")
    private String content;

    /**
     * 状态(0免费，1收费)
     */
    @ApiParam("状态(0免费，1收费)")
    @TableField("status")
    private Byte status;

    /**
     * 创建时间
     */
    @ApiParam("创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @ApiParam("更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
